////////////////////////////////////////////////////////////////////////////////
// Filename: transparent.ps
////////////////////////////////////////////////////////////////////////////////


/////////////
// GLOBALS //
/////////////
Texture2D shaderTexture;
SamplerState SampleType;

cbuffer TransparentBuffer
{
  float blendAmount;
};


//////////////
// TYPEDEFS //
//////////////
struct PixelInputType
{
    float4 position : SV_POSITION;
    float2 tex : TEXCOORD0;
};


////////////////////////////////////////////////////////////////////////////////
// Pixel Shader
////////////////////////////////////////////////////////////////////////////////
float4 TransparentPixelShader(PixelInputType input) : SV_TARGET
{
  float4 color;
  
  
  // Sample the texture pixel at this location.
    color = shaderTexture.Sample(SampleType, input.tex);

  // Set the alpha value of this pixel to the blending amount to create the alpha blending effect.
  if (blendAmount != 1.0f && color.a != 0.0) {
    color.a = blendAmount;
  }

  // If the color is white it is text, color it.
  //if(color.r == 1.0f && color.g == 1.0f && color.b == 1.0f)  {
  //  color.a = 0.0f;
  //}

  return color;
}
